//引用Vuex
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)

//实例store对象
const store = new Vuex.Store({
	state: {
		userToken: "",
	},
	//mutations是修改store数据入口
	mutations: {
		SET_USER_TOKEN(state, msg) {
			// // console.log("SET_USER_TOKEN msg:",msg)
			uni.setStorage({
				key: 'userToken',
				data: msg,
			});
			state.userToken = msg;
		},
	}
})

//导出store对象
export default store
